package hub.gongshang.enums;

import lombok.Getter;
/**
 * @author LoneWalker
 */
@Getter
public enum ResultCodeEnum{
    /**
     * success
     */
    SUCCESS(200,"操作成功"),
    /**
     * fail
     */
    FAIL(500,"系统异常"),
    /**
     * 参数错误：1001-1999
     */
    PARAM_IS_INVALID(1001,"参数无效"),
    PARAM_TYPE_ERROR(1002,"参数类型错误"),
     BAD_REQUEST(400, "请求参数错误"),
    UNAUTHORIZED(401, "未授权"),
    FORBIDDEN(403, "禁止访问"),
    NOT_FOUND(404, "资源不存在"),
    INTERNAL_SERVER_ERROR(500, "服务器内部错误"),
    SERVICE_UNAVAILABLE(503, "服务不可用"),

    // 业务错误码
    USER_NOT_EXIST(1001, "用户不存在"),
    USER_EXIST(1002, "用户已存在"),
    INVALID_PASSWORD(1003, "密码错误");
    /**
     * 状态码
     */
    private final int code;
    /**
     * 提示信息
     */
    private final String message;
    ResultCodeEnum(Integer code, String message){
        this.code = code;
        this.message = message;
    }
}
